package com.credithc.customers.manager.echarts;

import com.credithc.customers.manager.po.ExceptionStatsPo;
import com.github.abel533.echarts.code.Orient;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhukai
 * @date 2018/12/22 10:23
 */
public class ExceptionPie extends EChartsCommon {

    private static List<String> rowList = new ArrayList<>();

    static {
        rowList.add("累计");
    }

    public ExceptionPie(List<ExceptionStatsPo> pos, List<String> colList) {
        super(rowList, colList);
        for (ExceptionStatsPo po : pos) {
            setValue(po.getType(),po.getCount());
        }
    }

    public String generateGraph() {
        String str = createGraph(null, null).createPie("累计", "60%", "50%", "50%").createInsideLabel().createLeftLegend(columnList, 0, 0, Orient.vertical).toJSONString();
        return str;
    }
}
